<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.EditProjetoTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.EditProjetoLabel_idObra}" for="idObra" />
                    <h:inputText id="idObra" value="#{projetoController.selected.idObra}" title="#{bundle.EditProjetoTitle_idObra}" required="true" requiredMessage="#{bundle.EditProjetoRequiredMessage_idObra}"/>
                    <h:outputLabel value="#{bundle.EditProjetoLabel_titulo}" for="titulo" />
                    <h:inputText id="titulo" value="#{projetoController.selected.titulo}" title="#{bundle.EditProjetoTitle_titulo}" required="true" requiredMessage="#{bundle.EditProjetoRequiredMessage_titulo}"/>
                    <h:outputLabel value="#{bundle.EditProjetoLabel_descricao}" for="descricao" />
                    <h:inputText id="descricao" value="#{projetoController.selected.descricao}" title="#{bundle.EditProjetoTitle_descricao}" required="true" requiredMessage="#{bundle.EditProjetoRequiredMessage_descricao}"/>
                    <h:outputLabel value="#{bundle.EditProjetoLabel_responsavel}" for="responsavel" />
                    <h:inputText id="responsavel" value="#{projetoController.selected.responsavel}" title="#{bundle.EditProjetoTitle_responsavel}" required="true" requiredMessage="#{bundle.EditProjetoRequiredMessage_responsavel}"/>
                    <h:outputLabel value="#{bundle.EditProjetoLabel_fkUsuario}" for="fkUsuario" />
                    <h:selectOneMenu id="fkUsuario" value="#{projetoController.selected.fkUsuario}" title="#{bundle.EditProjetoTitle_fkUsuario}" required="true" requiredMessage="#{bundle.EditProjetoRequiredMessage_fkUsuario}">
                        <f:selectItems value="#{usuarioController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                    <h:outputLabel value="#{bundle.EditProjetoLabel_dataInicial}" for="dataInicial" />
                    <h:inputText id="dataInicial" value="#{projetoController.selected.dataInicial}" title="#{bundle.EditProjetoTitle_dataInicial}" required="true" requiredMessage="#{bundle.EditProjetoRequiredMessage_dataInicial}">
                        <f:convertDateTime pattern="MM/dd/yyyy" />
                    </h:inputText>
                    <h:outputLabel value="#{bundle.EditProjetoLabel_dataFinal}" for="dataFinal" />
                    <h:inputText id="dataFinal" value="#{projetoController.selected.dataFinal}" title="#{bundle.EditProjetoTitle_dataFinal}" required="true" requiredMessage="#{bundle.EditProjetoRequiredMessage_dataFinal}">
                        <f:convertDateTime pattern="MM/dd/yyyy" />
                    </h:inputText>
                    <h:outputLabel value="#{bundle.EditProjetoLabel_entrega}" for="entrega" />
                    <h:inputText id="entrega" value="#{projetoController.selected.entrega}" title="#{bundle.EditProjetoTitle_entrega}" >
                        <f:convertDateTime pattern="MM/dd/yyyy" />
                    </h:inputText>
                </h:panelGrid>
                <h:commandLink action="#{projetoController.update}" value="#{bundle.EditProjetoSaveLink}"/>
                <br />
                <br />
                <h:commandLink action="View" value="#{bundle.EditProjetoViewLink}" immediate="true"/>
                <br />
                <h:commandLink action="#{projetoController.prepareList}" value="#{bundle.EditProjetoShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:commandLink value="#{bundle.EditProjetoIndexLink}" action="/index" immediate="true" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
